package com.edu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 教材基本信息表
 * @TableName textbook_info
 */
@TableName(value ="textbook_info")
@Data
public class TextbookInfo {
    /**
     * 教材ID
     */
    @TableId(type = IdType.AUTO)
    private Long textbookId;

    /**
     * 教材编号
     */
    private String textbookCode;

    /**
     * 教材名称
     */
    private String textbookName;

    /**
     * 作者
     */
    private String author;

    /**
     * 出版社
     */
    private String publisher;

    /**
     * ISBN号
     */
    private String isbn;

    /**
     * 学科分类
     */
    private String subjectCategory;

    /**
     * 单价
     */
    private BigDecimal price;

    /**
     * 教材描述
     */
    private String description;

    /**
     * 状态
     */
    private Object status;

    /**
     * 版本
     */
    private String edition;

    /**
     * 出版日期
     */
    private Date publicationDate;

    /**
     * 是否最新版本
     */
    private Integer latestEdition;

    /**
     * 前一版本ID
     */
    private Long previousEditionId;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TextbookInfo other = (TextbookInfo) that;
        return (this.getTextbookId() == null ? other.getTextbookId() == null : this.getTextbookId().equals(other.getTextbookId()))
            && (this.getTextbookCode() == null ? other.getTextbookCode() == null : this.getTextbookCode().equals(other.getTextbookCode()))
            && (this.getTextbookName() == null ? other.getTextbookName() == null : this.getTextbookName().equals(other.getTextbookName()))
            && (this.getAuthor() == null ? other.getAuthor() == null : this.getAuthor().equals(other.getAuthor()))
            && (this.getPublisher() == null ? other.getPublisher() == null : this.getPublisher().equals(other.getPublisher()))
            && (this.getIsbn() == null ? other.getIsbn() == null : this.getIsbn().equals(other.getIsbn()))
            && (this.getSubjectCategory() == null ? other.getSubjectCategory() == null : this.getSubjectCategory().equals(other.getSubjectCategory()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getEdition() == null ? other.getEdition() == null : this.getEdition().equals(other.getEdition()))
            && (this.getPublicationDate() == null ? other.getPublicationDate() == null : this.getPublicationDate().equals(other.getPublicationDate()))
            && (this.getLatestEdition() == null ? other.getLatestEdition() == null : this.getLatestEdition().equals(other.getLatestEdition()))
            && (this.getPreviousEditionId() == null ? other.getPreviousEditionId() == null : this.getPreviousEditionId().equals(other.getPreviousEditionId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTextbookId() == null) ? 0 : getTextbookId().hashCode());
        result = prime * result + ((getTextbookCode() == null) ? 0 : getTextbookCode().hashCode());
        result = prime * result + ((getTextbookName() == null) ? 0 : getTextbookName().hashCode());
        result = prime * result + ((getAuthor() == null) ? 0 : getAuthor().hashCode());
        result = prime * result + ((getPublisher() == null) ? 0 : getPublisher().hashCode());
        result = prime * result + ((getIsbn() == null) ? 0 : getIsbn().hashCode());
        result = prime * result + ((getSubjectCategory() == null) ? 0 : getSubjectCategory().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getEdition() == null) ? 0 : getEdition().hashCode());
        result = prime * result + ((getPublicationDate() == null) ? 0 : getPublicationDate().hashCode());
        result = prime * result + ((getLatestEdition() == null) ? 0 : getLatestEdition().hashCode());
        result = prime * result + ((getPreviousEditionId() == null) ? 0 : getPreviousEditionId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", textbookId=").append(textbookId);
        sb.append(", textbookCode=").append(textbookCode);
        sb.append(", textbookName=").append(textbookName);
        sb.append(", author=").append(author);
        sb.append(", publisher=").append(publisher);
        sb.append(", isbn=").append(isbn);
        sb.append(", subjectCategory=").append(subjectCategory);
        sb.append(", price=").append(price);
        sb.append(", description=").append(description);
        sb.append(", status=").append(status);
        sb.append(", edition=").append(edition);
        sb.append(", publicationDate=").append(publicationDate);
        sb.append(", latestEdition=").append(latestEdition);
        sb.append(", previousEditionId=").append(previousEditionId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}